/**
 * Generate time : 2011-06-24 14:56:02
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.cm.domain;

import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCMMaterialBaseHis
 * 
 */
public class ZMCMMaterialBaseHis extends DaoEPBase {

	private String fdKeyId = " "; /* 主键 */
	private String fdYear = " "; /* 年份 */
	private String fdMonth = " "; /* 月份 */
	private String fdPeople = " "; /* 结转人 */
	private String fdHisDate = " "; /* 结转日期 */
	private Double fdHisSum = new Double(0); /* 库存金额合计 */
	private String fdRemark = " "; /* 备注 */

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("主键");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdYear");
		eiColumn.setFieldLength(4);
		eiColumn.setDescName("年份");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdMonth");
		eiColumn.setFieldLength(2);
		eiColumn.setDescName("月份");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdPeople");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("结转人");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdHisDate");
		eiColumn.setFieldLength(10);
		eiColumn.setDescName("结转日期");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdHisSum");
		eiColumn.setType("N");
		eiColumn.setScaleLength(5);
		eiColumn.setFieldLength(15);
		eiColumn.setDescName("库存金额合计");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdRemark");
		eiColumn.setFieldLength(500);
		eiColumn.setDescName("备注");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZMCMMaterialBaseHis() {
		initMetaData();
	}

	/**
	 * get the fdKeyId - 主键
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId - 主键
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdYear - 年份
	 * 
	 * @return the fdYear
	 */
	public String getFdYear() {
		return this.fdYear;
	}

	/**
	 * set the fdYear - 年份
	 */
	public void setFdYear(String fdYear) {
		this.fdYear = fdYear;
	}

	/**
	 * get the fdMonth - 月份
	 * 
	 * @return the fdMonth
	 */
	public String getFdMonth() {
		return this.fdMonth;
	}

	/**
	 * set the fdMonth - 月份
	 */
	public void setFdMonth(String fdMonth) {
		this.fdMonth = fdMonth;
	}

	/**
	 * get the fdPeople - 结转人
	 * 
	 * @return the fdPeople
	 */
	public String getFdPeople() {
		return this.fdPeople;
	}

	/**
	 * set the fdPeople - 结转人
	 */
	public void setFdPeople(String fdPeople) {
		this.fdPeople = fdPeople;
	}

	/**
	 * get the fdHisDate - 结转日期
	 * 
	 * @return the fdHisDate
	 */
	public String getFdHisDate() {
		return this.fdHisDate;
	}

	/**
	 * set the fdHisDate - 结转日期
	 */
	public void setFdHisDate(String fdHisDate) {
		this.fdHisDate = fdHisDate;
	}

	/**
	 * get the fdHisSum - 库存金额合计
	 * 
	 * @return the fdHisSum
	 */
	public Double getFdHisSum() {
		return this.fdHisSum;
	}

	/**
	 * set the fdHisSum - 库存金额合计
	 */
	public void setFdHisSum(Double fdHisSum) {
		this.fdHisSum = fdHisSum;
	}

	/**
	 * get the fdRemark - 备注
	 * 
	 * @return the fdRemark
	 */
	public String getFdRemark() {
		return this.fdRemark;
	}

	/**
	 * set the fdRemark - 备注
	 */
	public void setFdRemark(String fdRemark) {
		this.fdRemark = fdRemark;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdYear(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdYear")), fdYear));
		setFdMonth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdMonth")), fdMonth));
		setFdPeople(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdPeople")), fdPeople));
		setFdHisDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdHisDate")), fdHisDate));
		setFdHisSum(NumberUtils.toDouble(StringUtils.toString(map.get("fdHisSum")), fdHisSum));
		setFdRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdRemark")), fdRemark));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdYear", StringUtils.toString(fdYear, eiMetadata.getMeta("fdYear")));
		map.put("fdMonth", StringUtils.toString(fdMonth, eiMetadata.getMeta("fdMonth")));
		map.put("fdPeople", StringUtils.toString(fdPeople, eiMetadata.getMeta("fdPeople")));
		map.put("fdHisDate", StringUtils.toString(fdHisDate, eiMetadata.getMeta("fdHisDate")));
		map.put("fdHisSum", StringUtils.toString(fdHisSum, eiMetadata.getMeta("fdHisSum")));
		map.put("fdRemark", StringUtils.toString(fdRemark, eiMetadata.getMeta("fdRemark")));

		return map;

	}
}